<link rel="stylesheet" href="${ctxPath}/css/plugin/ztree/ztree.css"/>
<link rel="stylesheet" href="${ctxPath}/css/pages/nav_manage.css"/>
<script type="text/javascript" src="${ctxPath}/js/plugin/ztree/jquery.ztree.all-3.5.js"></script>
<script type="text/javascript" src="${ctxPath}/js/pages/nav_manage.js"></script>
<div class="pageheader">
    <h2><i class="fa fa-book"></i> 我的文章 <span>导航管理</span></h2>

    <div class="breadcrumb-wrapper">
        <span class="label">当前位置:</span>
        <ol class="breadcrumb">
            <li><a href="calendar.html">我的文章</a></li>
            <li class="active">导航管理</li>
        </ol>
    </div>
</div>
<div class="contentpanel">
    <div class="panel panel-dark panel-alt">
        <div class="panel-heading">
            <div class="panel-btns">
                <a href="javascript:;" id="addNavBtn" class="tooltips" data-toggle="tooltip"
                   data-original-title="Add New"><i class="glyphicon glyphicon-plus"></i></a>
            </div>
            <h3 class="panel-title">首页导航管理</h3>
        </div>
        <div class="panel-body">
            <div class="table-responsive">
                <table id="navTable" class="table">
                    <thead>
                    <tr>
                        <th class="col-md-2" name="nav_name">导航名称</th>
                        <th class="col-md-1" name="nav_parent">上级</th>
                        <th class="col-md-1" name="nav_sort">排序</th>
                        <th class="col-md-2" name="nav_url">菜单地址</th>
                        <th class="col-md-2" name="nav_createtime">创建时间</th>
                        <th class="col-md-1" name="nav_createuser">创建人</th>
                        <th class="col-md-3" name="nav_operation">分类操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<!--增加文章分类对话框-->
<div id="addNavDialog" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">添加首页导航</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label for="addNavName">导航名称</label>
                    <input type="text" class="form-control" id="addNavName" placeholder="不能为空！">
                </div>
                <div class="form-group">
                    <label for="addNavName">导航地址</label>
                    <input type="text" class="form-control" id="addNavUrl" placeholder="">
                </div>
                <div class="form-group">
                    <label for="addNavSort">导航排序</label>
                    <input type="text" class="form-control" id="addNavSort" placeholder="">
                </div>
                <div class="form-group">
                    <label for="addNavLevel">导航级别</label>
                    <select id="addNavLevel" class="form-control">
                        <option value="0">顶级导航</option>
                        <option value="1">二级导航</option>
                    </select>
                </div>
                <div id="addParentNavDiv" class="form-group hidden">
                    <label for="addParentNav">上级导航</label>
                    <select id="addParentNav" class="form-control">
                    </select>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="addNav()">增加</button>
            </div>
        </div>
    </div>
</div>
<!--编辑文章分类对话框-->
<div id="editNavDialog" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">编辑首页导航</h4>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    <label for="editNavName">导航名称</label>
                    <input type="text" class="form-control" id="editNavName" placeholder="不能为空！">
                </div>
                <div class="form-group">
                    <label for="editNavUrl">导航地址</label>
                    <input type="text" class="form-control" id="editNavUrl" placeholder="">
                </div>
                <div class="form-group">
                    <label for="editNavSort">导航排序</label>
                    <input type="text" class="form-control" id="editNavSort" placeholder="">
                </div>
                <div class="form-group">
                    <label for="editNavLevel">导航级别</label>
                    <select id="editNavLevel" class="form-control">
                        <option value="0">顶级导航</option>
                        <option value="1">二级导航</option>
                    </select>
                </div>
                <div id="editParentNavDiv" class="form-group hidden">
                    <label for="editParentNav">上级导航</label>
                    <select id="editParentNav" class="form-control">
                    </select>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="updateNav()">更新</button>
            </div>
        </div>
    </div>
</div>
<!--配置导航的文章分类-->
<div id="configNavClassifyDialog" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">配置导航分类</h4>
            </div>
            <div class="modal-body">
               <ul id="configNavClassifyTree"  class="ztree"></ul>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                <button type="button" class="btn btn-primary" onclick="saveConfigNavClassify()">保存</button>
            </div>
        </div>
    </div>
</div>